<!DOCTYPE HTML>
<html lang="en">
<head>
	<meta charset="GBK">
	<title></title>
	<script type="text/javascript" src="http://a.tbcdn.cn/??s/yui/3.3.0/build/yui/yui-min.js,s/yui/3.3.0/build/loader/loader-min.js"></script>
	<script type="text/javascript" src="../../src/yui-wrapper/yui-juicer.js"></script>
</head>
<body>

<script type="text/javascript">
YUI().use('juicer',function(Y) {
    var data={
        list:[
            {name:'guokai',show:true},
            {name:'benben',show:false},
            {name:'dier',show:true}
        ],
        blah:[
            {num:1},
            {num:2},
            {num:3,inner:[
                {'time':'15:00'},
                {'time':'16:00'},
                {'time':'17:00'},
                {'time':'18:00'}
            ]},
            {num:4}
        ]
    };

    var tpl=[
        '<ul>',
            '{@each list as it, k}',
                '<li>${it.name} (index: ${k})</li>',
            '{@/each}',
            '{# first level attribute must specify the "data." prefix}',
            '{@each blah as it}',
                '<li>',
                    'num: ${it.num} <br />',
                    '{@if it.num==3}',
                        '{@each it.inner as it2}',
                            '${it2.time} <br />',
                        '{@/each}',
                    '{@/if}',
                '</li>',
            '{@/each}',
        '</ul>'
    ].join('\n');

    Y.juicer.set('cache',true);
    Y.juicer.set('errorhandling',false);
    Y.juicer.set('strip',true);
    Y.juicer.set('detection',false);

    document.write(Y.juicer(tpl,data));
});
</script>

</body>
</html>
